package com.cobra.rdd.operator.action

import org.apache.spark.{SparkConf, SparkContext}

object Spark06_RDD_Operator_TakeOrdered {
  def main(args: Array[String]): Unit = {

    val sparkConf = new SparkConf().setMaster("local[*]").setAppName("Spark06_RDD_Operator_TakeOrdered")
    val sc = new SparkContext(sparkConf)
    val rdd = sc.makeRDD(List(4,2,3,1))
    //获取数据的前几个
    val i = rdd.takeOrdered(3)
    println(i.mkString(","))
    sc.stop()
  }
}
